import sys
sys.path.append('.')
from data.business_data import test_data as testdata
from base.runmethod import run_main

# 服务器地址
base_url = "http://49.233.108.117:3000"

# 用户名
name = "test39"

pw = '123456'
# 获取cookie
def read_cookie():
    metho = 'post'
    url = base_url+'/signin'
    body = {'name':name,'pass':pw}
    rp_cookie = run_main(metho,url,body)
    return rp_cookie.cookies


# 获取token
# token = '6408e585-4712-4583-ba68-09e0ce7edebd'
def read_token():
    metho = 'post'
    url = base_url+'/user/refresh_token'
    body = {}
    cookies = read_cookie()
    res = run_main(metho,url,body,cookies).json()['accessToken']
    return res

token = read_token()

cookie = read_cookie()
